<div class="main-content">
    <div class="container">
        <div class="row">
            <div class="col-sm-12">
                <ol class="breadcrumb">
                    <li>
                        <i class="clip-file"></i>
                        <a href="#">
                            Logística
                        </a>
                    </li>
                    <li class="active">
                        Compras
                    </li>					
                </ol>
                <div class="page-header">
                    <h1>Compras <small>Listado</small></h1>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <!-- start: DYNAMIC TABLE PANEL -->
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <i class="icon-external-link-sign"></i>
                        Productos
                        <div class="panel-tools">
                            <a class="btn btn-xs btn-link panel-collapse collapses" href="#">
                            </a>
                            <a class="btn btn-xs btn-link panel-config" href="#panel-config" data-toggle="modal">
                                <i class="icon-wrench"></i>
                            </a>
                            <a class="btn btn-xs btn-link panel-refresh" href="#">
                                <i class="icon-refresh"></i>
                            </a>
                            <a class="btn btn-xs btn-link panel-expand" href="#">
                                <i class="icon-resize-full"></i>
                            </a>
                            <!--<a class="btn btn-xs btn-link panel-close" href="#">
                                <i class="icon-remove"></i>
                            </a> -->
                        </div>
                    </div>
                    <div class="panel-body">
                        <table class="table table-striped table-bordered table-condensed table-hover table-full-width" id="sample_1">
                            <thead>
                                <tr>
                                    <th>Código</th>
                                    <th>Proveedor</th>
                                    <th>Comprobante</th>
                                    <th>Serie</th>
                                    <th>Número</th>
                                    <th>Fecha</th>
                                    <th>Total</th>
                                    <th></th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
                                if (!empty($compras)) :
                                    foreach ($compras as $fila):
                                        ?>
                                <tr id="detalle" style="cursor: pointer;" onclick="listarDetalle('compra','<?= base_url("logistica/proceso/listarDetalles"); ?>','<?=$fila->cod_comp?>');" >
                                    <td class="press"><?= $fila->cod_comp; ?></td>
                                    <td class="press"><?= $fila->nom_pro; ?></td>  
                                    <td class="press"><?= $fila->desc_comp; ?></td>
                                    <td class="press"><?= $fila->serie; ?></td>
                                    <td class="press"><?= $fila->numero; ?></td>
                                    <td class="press"><?= $fila->fecha; ?></td>
                                    <td class="press"><?= $fila->total; ?></td>
                                            <td class="center">
                                                <div class='visible-md visible-lg hidden-sm hidden-xs'>
                                                    <a class='btn btn-teal tooltips panel-config' data-toggle='modal' href="#">
                                                        <i class='icon-edit'></i>
                                                    </a>
                                                </div>
                                                <div class="visible-xs visible-sm hidden-md hidden-lg">
                                                    <div class="btn-group">
                                                        <a class="btn btn-primary dropdown-toggle btn-sm" data-toggle="dropdown" href="#">
                                                            <i class="icon-cog"></i> <span class="caret"></span>
                                                        </a>
                                                        <ul role="menu" class="dropdown-menu pull-right">
                                                            <li role="presentation">
                                                                <a role="menuitem" tabindex="-1" href="#">
                                                                    <i class="icon-edit"></i> Editar
                                                                </a>
                                                            </li>
                                                        </ul>
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                        <?php
                                    endforeach;
                                endif;
                                ?>       					
                            </tbody>
                        </table>

                    </div>
                </div>
                <!-- end: DYNAMIC TABLE PANEL -->
            </div>
        </div>
    </div>
</div>
<div id="vtnDetCompra" title="Detalle Compra">
    <table id="lstDetalle" class="table table-condensed table-hover">
        <thead>
        <th>Código</th>
        <th>Producto</th>
        <th>Cantidad</th>
        <th>Precio</th>
        <th>Importe</th>
        </thead>
        <tbody>
            
        </tbody>
    </table>
</div> 
<script type="text/javascript">
    $(function() {
        ventana("vtnDetCompra", 500, 300, false, "center");
        $("#detalle .press").click(function() {
            $("#vtnDetCompra").dialog("open");
        });
    });
</script>